<template>
    <a-modal
    :title="title"
    :visible="openDialog"
    :maskClosable="false"
    :destroyOnClose="true"
    :footer="null"
    @cancel="mainDialogClose()"
    width="80%"
  >
    <div style="border:#000 1px solid;">
        <!-- <a-row type="flex" justify="center" gutter="20px">
      <a-col :flex="'100px'" style="background-color:lightgrey">100px</a-col>
      <a-col flex="1" style="background-color:grey">auto</a-col>
    </a-row> -->
        <MouldSytepDialogContent :stepLists="stepLists" />
    </div>
  </a-modal>
</template>

<script>
import api from "@/server/mouldConfig.js";
import MouldSytepDialogContent from "./mouldSytepDialogContent.vue";

export default {
    name: 'MouldStepPageDialog',
    props: {
        openDialog: Boolean,
        title: String,
        data: Object
    },
    components: {
        MouldSytepDialogContent
    },
    data() {
        return {
            stepLists: []
        }
    },
    methods: {
        mainDialogClose() {
      this.$emit("update:openDialog", false);
    },
    getTreeData(params, key) {
    //   api.getSteps(this.data.orderId).then(res => {
          api.findByMouldToProcess({ mouldId: this.data.mouldId }).then(res => {
        if (res.code == 200) {
          let { data } = res;
          this[key] = data;
        }
      });
    },
    },
    created(){
        this.getTreeData({}, "stepLists");
    }
}
</script>
